<?php
//include('top.php');
require_once('pasmy/dbwaarden.php');
require_once('printstyle.php');
?>

<h3><div style="text-align: center"><a href="delsaux2.php#toevoegen" class="linkblue"><?php echo $ztoevoegen[$taal];?></a></div></h3>

<?php
$mysql_id = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($db, $mysql_id);

if(isset($_POST["toevoegen"])) {
	//$sql = "insert into delkm (`km`,`plaats`,`zip`) VALUES ('$_POST[delkm]','$_POST[ville]','$_POST[zip]'";
	$sql = "INSERT INTO `delkm` (`km`, `plaats`, `zip`) VALUES ('$_POST[delkm]', '$_POST[ville]', '$_POST[zip]');";
	$res = mysql_query($sql, $mysql_id);
	$fout = mysql_errno($mysql_id);
	if($fout != 0) {
		$fout = mysql_error($mysql_id);
		echo '<div style="text-align: center"><h3><font color = "#FF2306">' . $fout . '</font></h3></div>';
		mysql_close($mysql_id);
		echo '</body></html>';
		exit;
	
	}
}
/*foreach($_POST as $sleutel => $waarde) {
		echo "sleutel = $sleutel en waarde = |$waarde| <br>";
		}*/
$kilometers=array("-----","1-50","51-120","121-200","201-280","281-350");
?>
<table width="80%" align="center" border="1">
<tr><td colspan="7" bgcolor="orange"><div style="text-align: center"><strong><font size="4"><?php echo $pprijz[$taal];?> Delsaux</font></strong></div></td>
</tr>
<tr>
<td class="delsaux2"><div style="text-align: center"><strong><?php echo $afstand[$taal];?></strong></div></td>
<td class="delsaux2"><div style="text-align: center"><strong>1 pal</strong></div></td>
<td class="delsaux2"><div style="text-align: center"><strong>2 pal</strong></div></td>
<td class="delsaux2"><div style="text-align: center"><strong>3 pal</strong></div></td>
<td class="delsaux2"><div style="text-align: center"><strong>4-8 pal</strong></div></td>
<td class="delsaux2"><div style="text-align: center"><strong>9-16 pal</strong></div></td>
<td class="delsaux2"><div style="text-align: center"><strong>17-21</strong></div></td>
<!-- <td><div style="text-align: center"><strong></strong></div></td> -->

</tr>
<?php
$sql = "SELECT * FROM delsaux2";
$res = mysql_query($sql, $mysql_id);
while ($row = mysql_fetch_row($res)) {
	
	echo "<tr bgcolor='$row[7]'><td><div style=\"text-align: left\"><strong>$row[0]</strong></div></td>";
	echo "<td><div style=\"text-align: center\"><strong>$row[1]</strong></div></td>";
	echo "<td><div style=\"text-align: center\"><strong>$row[2]</strong></div></td>";
	echo "<td><div style=\"text-align: center\"><strong>$row[3]</strong></div></td>";
	echo "<td><div style=\"text-align: center\"><strong>$row[4]</strong></div></td>";
	echo "<td><div style=\"text-align: center\"><strong>$row[5]</strong></div></td>";
	echo "<td><div style=\"text-align: center\"><strong>$row[6]</strong></div></td></tr>";
	}
mysql_free_result($res);
echo "</table>\n<br /><br />";
include('zones.php');
?>
<br /><h3><div style="text-align: center"><a name="toevoegen"><?php echo $ztoevoegen[$taal];?></a></div></h3>
<table>
<form action="delsaux2.php" method="post">
<tr>
<td><strong><?php echo $kmafstand[$taal];?></strong></td><td><input type="text" name="delkm" size="5" maxlength="5" /></td>
</tr>
<tr>
<td><strong><?php echo $plaats[$taal];?></strong></td><td><input type="text" name="ville" size="25" maxlength="80" /></td>
</tr>
<tr>
<td><strong><?php echo $postcode[$taal];?> (B-xxxx <?php echo $of[$taal];?> F-xxxxx)</strong></td><td><input type="text" name="zip" size="6" maxlength="10" /></td>
</tr>
<tr>
<td colspan="2"><br /><div style="text-align: center"><input type="submit" name="toevoegen" value="<?php echo $toevoegen[$taal];?>" /></div></td>
</tr>
</form>
</table>

<?php
//include('footer.php');
?>